<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./css/swiper-bundle.min.css">
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    .swiper-container {
        width: 600px;
        height: 400px;
        margin: 50px auto;
    }

    .swiper-container img {
        width: 600px;
        height: 400px;
    }
</style>

<body>
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide"><img src="./img/1.jpg" alt=""></div>
            <div class="swiper-slide"><img src="./img/2.webp" alt=""></div>
            <div class="swiper-slide"><img src="./img/3.jfif" alt=""></div>
            <div class="swiper-slide"><img src="./img/4.jfif" alt=""></div>
            <div class="swiper-slide"><img src="./img/5.jfif" alt=""></div>
            <div class="swiper-slide"><img src="./img/6.png" alt=""></div>
        </div>
        <!-- 如果需要分页器 -->
        <div class="swiper-pagination"></div>
        <!-- 如果需要导航按钮 -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>

        <!-- 如果需要滚动条 -->
        <div class="swiper-scrollbar"></div>
    </div>

    <script src="./js/swiper-bundle.min.js"></script>
    <script>
        new Swiper('.swiper-container', {
            // direction: 'vertical', // 垂直切换选项
            loop: true, // 循环模式选项
            initialSlide: 0,//默认进入选中状态的下标
            effect : 'cube', //切换状态
            autoplay:true,//自动轮播  等同于以下
             /*autoplay: {
            delay: 3000,
            stopOnLastSlide: false,  // 如果设置为true，当切换到最后一个slide时停止自动切换。（loop模式下无效）。
            disableOnInteraction: true,  //用户操作swiper之后，是否禁止autoplay。默认为true：停止。如果设置为false，用户操作swiper之后自动切换不会停止，每次都会重新启动autoplay。
            },*/
            // 如果需要分页器
            pagination: {
                el: '.swiper-pagination',
                clickable: true,  //点击小原点切换图片
            },
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
        })
    </script>
</body>

</html>